home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / jpl_c.zip / UNGETC.C < prev    next >
Text File  |  1988-08-06  |  768b  |  25 lines

  1. /* 1.0  12-17-84 */
  2. /************************************************************************
  3.  *            Robert C. Tausworthe                *
  4.  *            Jet Propulsion Laboratory            *
  5.  *            Pasadena, CA 91009        1984        *
  6.  ************************************************************************/
  7.  
  8. #include "defs.h"
  9. #include "stdtyp.h"
  10. #include "stdio.h"
  11.  
  12.  
  13. /************************************************************************/
  14.     METACHAR
  15. ungetc(c, fp)        /* Push c back onto FILE fp stream, and return c.
  16.                Return EOF if c is EOF.            */
  17. /*----------------------------------------------------------------------*/
  18. FAST FILE *fp;
  19. {
  20.     if ((c IS EOF) OR (fp->_bptr <= fp->_buff))
  21.         return EOF;
  22.  
  23.     return (*--fp->_bptr = c);
  24. }
  25.